<template>
	<div style="width:80%;height:80%;">
			 <div id="charts" style="height:480px;margin: auto"></div>
	</div>
	       

</template>

<script>
const echarts = require('echarts');
export default {
   methods: {
     // gotolink() {
     //   this.$router.replace('/enttypelist')
     // },
   },
   mounted() {
     var option;
     var myChart;
     this.$http.post('/log/personInform').then((res) => {
       myChart = echarts.init(document.getElementById('charts'));
       myChart.setOption({
         title: {
           text: '各部门人数统计图'
         },
         toolbox: {
           show: true,
           feature: {
             dataZoom: {
               yAxisIndex: 'none'
             },
             dataView: {readOnly: false},
             magicType: {type: ['line', 'bar']},
             restore: {},
             saveAsImage: {}
           }
         },
         tooltip: {},
         legend: {
           data: ['类型']
         },
         xAxis: {
           data: res.data.part
         },
         yAxis: {},
         series: [{
           name: '部门人数',
           type: 'bar',
           data: res.data.number
         }]
       });
       window.onresize = function () {
         myChart.resize();
         option.resize();
       }
     })
   }
}
</script>

<style>
</style>
